package com.lzh.yupao.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lzh.yupao.model.domain.Team;
import com.lzh.yupao.model.domain.User;
import com.lzh.yupao.model.dto.TeamQuery;
import com.lzh.yupao.model.request.DeleteRequest;
import com.lzh.yupao.model.request.TeamJoinRequest;
import com.lzh.yupao.model.request.TeamQuitRequest;
import com.lzh.yupao.model.request.TeamUpdateRequest;
import com.lzh.yupao.model.vo.TeamUserVO;

import java.util.List;


/**
 * 队伍(Team)表服务接口
 *
 * @author makejava
 * @since 2023-05-17 15:15:06
 */
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     * @param team
     * @param loginUser
     * @return 队伍id
     */
    Long addTeam(Team team, User loginUser);

    /**
     * 搜索队伍
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery, boolean isAdmin);

    /**
     * 修改队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

    /**
     * 解散队伍
     * @param teamDeleteRequest
     * @param loginUser
     * @return
     */
    boolean deleteTeam(DeleteRequest teamDeleteRequest, User loginUser);

}

